package model

import (
	"beetle/internal/pkg/constant"
)

// Pager 分页参数
type Pager struct {
	PageNum  int
	PageSize int
}

// Page 分页
type Page struct {
	Total int         `json:"total"`
	List  interface{} `json:"list"`
}

// Response
type Response struct {
	Code int
	Msg  string
	Data interface{}
}

func Success() Response {
	return Response{
		Code: constant.SUCCESS_CODE,
	}
}

func Data(data interface{}) Response {
	return Response{
		Code: constant.SUCCESS_CODE,
		Data: data,
	}
}

func Fail(msg string) Response {
	return Response{
		Code: constant.FAIL_CODE,
		Msg:  msg,
	}
}
